package com.u.social.abtest.api;

import com.u.social.abtest.service.ABService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @program: u-social
 * @description: 推荐逻辑服
 * @author: Alex Wu
 * @createDate: 2025-04-10 15:32
 **/

@Service
public class RecommendService {

    @Autowired
    private ABService abService;

    public String recommend(String userId) {
        String abTestResult = abService.getABTestResult(userId);
        switch(abTestResult) {
            case "A":
                System.out.println("推荐A");
                break;
            case "B":
                System.out.println("推荐B");
                break;
            default:
                System.out.println("推荐默认");
                break;
        }
        // 远程调用
        //1.获取用户特征
        //2.获取推荐配置
        //3.根据推荐配置进行推荐
        //4.返回推荐结果
        return "abtest 推荐结果";
    }
}
